package org.ciallo.simplemusicplayer.util;

import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;
import androidx.core.content.ContextCompat;

/**
 * @author Jukomu
 * @Description:
 * @Package: org.ciallo.simplemusicplayer.util
 * @Project: SimpleMusicPlayer
 * @name: PermissionUtil
 * @Date: 2025/6/11-21:17
 * @Filename: PermissionUtil
 */
public class PermissionUtil {
    public static boolean hasNotificationPermission(Context context) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
            return ContextCompat.checkSelfPermission(context, Manifest.permission.POST_NOTIFICATIONS)
                    == PackageManager.PERMISSION_GRANTED;
        }
        return true; // Android 13以下不需要此运行时权限
    }
}
